import { Card, Form, Input, Button } from 'antd';

export default () => {
  const [form] = Form.useForm();

  const onFinish = (values) => {
    console.log('收到表单值:', values);
  };

  return (
    <>
      <Card title="系统设置" bordered={false}>
        <Form form={form} onFinish={onFinish} layout="vertical">
          <Form.Item label="网站名称" name="siteName" rules={[{ required: true }]}
            initialValue="心之所向">
            <Input />
          </Form.Item>

          <Form.Item label="管理员邮箱" name="adminEmail" rules={[{ required: true, type: 'email' }]}
            initialValue="admin@example.com">
            <Input />
          </Form.Item>

          <Form.Item label="默认语言" name="defaultLanguage" rules={[{ required: true }]}
            initialValue="中文">
            <Input disabled />
          </Form.Item>

          <Form.Item>
            <Button type="primary" htmlType="submit">
              保存设置
            </Button>
          </Form.Item>
        </Form>
      </Card>
    </>
  );
};